package com.goods.povos;

import com.goods.entity.Book;
import com.goods.entity.Cartitem;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CartPovo extends Book {
    private Cartitem cartitem;
    private BigDecimal bigDecimal;

    public BigDecimal getSubtotal(){
//        单价
        BigDecimal bigDecimal = new BigDecimal(cartitem.getQuantity().toString());
//        数量
        BigDecimal currprice = getCurrprice();
        return currprice.multiply(bigDecimal);
    }
}
